const rulesData = {
  required: (msg, tirgger) => {
    return {required: true, message: msg || '该项为必填项', trigger: tirgger | 'blur'}
  },
  whitespace:(msg, tirgger) => {
    return {whitespace: true, message: msg || '该项为必填项', trigger: tirgger | 'blur'}
  },
  minMax: (min,max) => {
    return {min: min, max: max, message: '最短' + min + '个字符，最长' + max + '个字符', trigger: 'blur'}
  },
  max: (max) => {
    return {max: max, message: '不能超过' + max + '个字符', trigger: 'blur'}
  },
  min: (min) => {
    return {min: min, message: '最少' + min + '个字符', trigger: 'blur'}
  },
  type: (type) => {
    // string: Must be of type string. This is the default type.
    // number: Must be of type number.
    // boolean: Must be of type boolean.
    // method: Must be of type function.
    // regexp: Must be an instance of RegExp or a string that does not generate an exception when creating a new RegExp.
    // integer: Must be of type number and an integer.
    // float: Must be of type number and a floating point number.
    // array: Must be an array as determined by Array.isArray.
    // object: Must be of type object and not Array.isArray.
    // enum: Value must exist in the enum.
    // date: Value must be valid as determined by Date
    // url: Must be of type url.
    // hex: Must be of type hex.
    // email: Must be of type email.
    // any: Can be any type.
    const types = {
      string: '字符串',
      number: '数字',
      boolean: '布尔',
      method: '函数',
      array: '数组',
      object: '对象'
    }
    return {type: type, message: '必须为' + types[type] + '类型', trigger: 'blur'}
  }
}
export default rulesData
